<template>
	<view class="center">
		<view class="order" v-for="(item,index) in rammend1" :key="index">
			<u-table class="orderc">
				<u-tr>
					<u-th>联系方式</u-th>
					<u-th>地址</u-th>
					<u-th>备注</u-th>
					<u-th>取件码</u-th>
					
				</u-tr>
				<u-tr>
					<u-td>{{item.phone}}</u-td>
					<u-td>{{item.address}}</u-td>
					<u-td>{{item.remark}}</u-td>
					<u-td>{{item.code}}</u-td>
			
				</u-tr>
			</u-table>
			<u-line color="#e4e7ed" />
		</view>
		<view class="tites">
		<u-empty text="没有更多" mode="order" icon-size="50rpx"></u-empty>
		</view>
	</view>
</template>
	
<script>
	export default {
		data() {
			return {
				current: 0,
				swiperDotIndex: 0,
				rammend1:[],
				
			}
		},
		mounted(){
		  const db = uniCloud.database() //代码块为cdb
		  // 使用uni-clientDB
		  db.collection('uni-id-base-order')
		    .where({
		     orderuser_id:this.$store.state.user.info._id , status:2
		    }).get()
		    .then((res)=>{
		     this.rammend1=res.result.data
		    }).catch((err)=>{
		      console.log(err.code); // 打印错误码
		          console.log(err.message); // 打印错误内容
		    })
		  
		},
		methods: {
			done(){
				// const db = uniCloud.database();
				// let collection = db.collection("uni-id-base-order")
				// let res = collection.where({_id:this.id})
				//   .update({
				//     status:3
				//   }).then((res) => {
				//         uni.showToast({
				//             title: '任务完成'
				//         })
				//     })
				console.log(this.rammend1._id)
			}
		}
	}
</script>

<style lang="scss">
.center{
	top:10rpx;
	
	.order{
		.orderc{
			
		}
	}
	.tites{
		
	}
}
</style>